package com.dingteam.question.common.validation.module.option;

import com.dingteam.model.Result;
import com.dingteam.question.common.dto.QuestionPaperVerifyDTO;
import com.dingteam.question.common.dto.QuestionResultVerifyDTO;
import com.dingteam.question.common.enums.ModuleEnum;
import com.dingteam.question.common.validation.module.AbstractModuleOptionValidator;
import lombok.Getter;
import org.springframework.stereotype.Component;

/**
 * @author Jamin
 * @date 2019/07/08
 */
@Component
public class VoteImageTextValidator extends AbstractModuleOptionValidator {

	@Getter
	private final ModuleEnum module = ModuleEnum.VOTE_IMG_TEXT;

	@Override
	public boolean supportModule(ModuleEnum moduleEnum) {
		return module.equals(moduleEnum);
	}

	@Override
	public Result<String> createValid(QuestionPaperVerifyDTO.QuestionItemDTO itemDTO) {
		return validCreateIndefinite(itemDTO);
	}

	@Override
	public Result<String> submitValid(QuestionResultVerifyDTO.ItemResultDTO item) {
		return validSubmitIndefinite(item);
	}
}
